# -*- coding: utf-8 -*-

"""
@Time    : 11/13/17 5:20 PM
@Author  : wong
@E-Mail  : wmx3ng@gmail.com
@File    : models.py.py
@Software: PyCharm
@Description: database ORM models.
"""
from app.run import db


class User(db.Model):
    __tablename__ = 'users'
    # 每个属性定义一个字段
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(64), unique=True)
    password = db.Column(db.String(64))

    # def __init__(self, id, username, password):
    #     self.id = id
    #     self.username = username
    #     self.password = password

    def __repr__(self):
        return '<User %r>' % self.username
